package com.example.interview.parent_son2;

import com.alibaba.fastjson.JSON;
import org.springframework.util.CollectionUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @author liangxin
 * @since 24/05/2021
 */
public class SysDeptController {

    public static void main(String[] args) throws NoSuchMethodException, NoSuchFieldException, IllegalAccessException, InvocationTargetException {
        ITree2Impl ITreeImpl = new ITree2Impl();//dataListInit() 用接口-实现的方式 避免static调用的出现的问题

        //查询所有tree + 带有searched功能的  搜索后展示 http://localhost:2080/system/dept/t14
//        List<SysDept> sysDepts4 = ITreeImpl.t14c(new SysDept());
//        System.out.println("--1-> " + sysDepts4);
//        if (!CollectionUtils.isEmpty(sysDepts4)) {
//            System.out.println("--2-> " + sysDepts4.size());
//            String str = JSON.toJSONString(sysDepts4);
//            System.out.println("--3-> " + str);
//        }

        //查询所有tree 默认展示
        List<SysDept> sysDepts3 = ITreeImpl.t13c(new SysDept());
        System.out.println("--4-> " + sysDepts3);
        if (!CollectionUtils.isEmpty(sysDepts3)) {
            System.out.println("--5-> " + sysDepts3.size());
            String str = JSON.toJSONString(sysDepts3);
            System.out.println("--6-> " + str);
        }
    }



}
